package net.vkits.api;

import net.vkits.admin.domain.model.QA;
import net.vkits.admin.domain.repository.QARepository;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by ethan-liu on 2017/1/23.
 */
@Controller
public class QAsApiController implements QAsApi {

    @Resource
    private QARepository qaRepository;

    @Override
    public ResponseEntity<List<QA>> qasGet() {
        List<QA> qaList = qaRepository.findAll();
        return new ResponseEntity<>(qaList, HttpStatus.OK);
    }
}
